home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / LISTMANA / __TESTER / TESTERUT.C < prev    next >
Text File  |  1989-06-25  |  2KB  |  87 lines

  1. /****                                                                    */
  2. /****    Code Testing System version 1.0 (beta)                            */
  3. /****                                                                    */
  4. /****    All portions of this source code are the property of Jack        */
  5. /****    Herrington.  I, Jack Herrington, give you permission to use        */
  6. /****    use or alter the code in any way that pleases you.  You must    */
  7. /****    however return by whatever means avaliable any improvements        */
  8. /****    you believe significant to Jack Herrington, accepting that        */
  9. /****    these improvements might be contained in later releases of        */
  10. /****    the code. I also grant you permission to remove this header        */
  11. /****    from any file you are WORKING on, as long as you put it back    */
  12. /****    when you're stopped WORKING on it.                                */
  13. /****                                                                    */
  14. /****    Jack Herrington: University Of Miami, Biomedical Computing        */
  15. /****                     1600 N.W. 10th Ave. (R-53)                        */
  16. /****                     (305) 547-6538                                    */
  17. /****                                                                    */
  18.  
  19. /****/
  20. /**** Tester utilities */
  21. /****/
  22.  
  23. #include "ListManager.h"
  24. #include "Tester.h"
  25.  
  26. /****/
  27. /**** Draw the fake grow handle */
  28. /****/
  29.  
  30. void DrawFakeGrow(Window)
  31. WindowPtr Window;
  32. {
  33.     GrafPtr port;
  34.     PicPtr growBox;
  35.     Rect frame;
  36.     int length,width;
  37.  
  38.     GetPort(&port);
  39.  
  40.     if(growBoxHandle==0L)return;
  41.  
  42.     HLock(growBoxHandle);
  43.     growBox=(PicPtr)*growBoxHandle;
  44.  
  45.     length = growBox->picFrame.right - growBox->picFrame.left;
  46.     width = growBox->picFrame.bottom - growBox->picFrame.top;
  47.  
  48.     frame.top = ( port->portRect.bottom - width ) + 1;
  49.     frame.bottom = ( port->portRect.bottom ) + 1;
  50.     frame.left = ( port->portRect.right - length ) + 1;
  51.     frame.right = ( port->portRect.right ) + 1;
  52.  
  53.     HUnlock(growBoxHandle);
  54.     if ( Window == FrontWindow() ) DrawPicture(growBoxHandle,&frame);
  55.     else EraseRect(&frame);
  56. }
  57.  
  58. /****/
  59. /**** Run a dialog */
  60. /****/
  61.  
  62. void RunDialog(resID)
  63. int resID;
  64. {
  65.     DialogPtr dialog;
  66.     Handle item;
  67.     Rect box;
  68.     int type,hit;
  69.  
  70.         /**** Get the dialog */
  71.  
  72.     if((dialog=GetNewDialog(resID,0L,-1L))==0L)return;
  73.  
  74.         /**** Frame the first item */
  75.  
  76.     SetPort(dialog);
  77.     GetDItem(dialog,1,&type,&item,&box);
  78.     InsetRect(&box,-4,-4);
  79.     PenSize(3,3);
  80.     FrameRoundRect(&box,16,16);
  81.     PenSize(1,1);
  82.  
  83.         /**** Run the modal dialog */
  84.  
  85.     ModalDialog(0L,&hit);
  86.     DisposDialog(dialog);
  87. }